﻿using System;
using System.IO;
using System.Collections.Generic;

namespace PokemonBattle.PokemonData
{
    /// <summary>
    /// Stream Item
    /// </summary>
    [Serializable()]
    public abstract class DataStream
    {
        public DataStream() { }

        public abstract void Load(Stream input);
        public abstract void Save(Stream output);

        internal static T FromStream<T>(Stream input) where T : DataStream
        {
            var obj = Activator.CreateInstance<T>();
            obj.Load(input);
            return obj;
        }
    }
}